function validation(frm, id, illegalChars, info, t_value, req){
	var err='';
	if(req=="required") {
		value=t_value.match(illegalChars[id]);
		//untuk data yag bkn required	
		if(!value || t_value==""){
			if(info[id]=="option"){
				msg="Required.";	
			}
			else {
				msg=""+info[id];
			}
			document.getElementById("alert-"+id).innerHTML= msg;
			$("#alert-"+id).show("fast");
			$("#"+id).addClass("error-form");
			err='true';
			document.getElementById(id).focus();
		}
		else {
			$("#"+id).removeClass("error-form");
			$("#alert-"+id).hide("fast");
		}
	}
	else {
		if(t_value!="") {
			value=t_value.match(illegalChars[id]);	
			if(!value){
				if(info[id]=="option"){
					msg="\n<br>Required.";	
				}
				else {
					msg="\n<br>"+info[id];
				}
				document.getElementById("alert-"+id).innerHTML= msg;
				$("#alert-"+id).show("fast");
				$("#"+id).addClass("error-form");
				err='true';
				//alert(id);
				document.getElementById(id).focus();
			}
			else {
				$("#"+id).removeClass("error-form");
				$("#alert-"+id).hide("fast");
			}		
		}
		else {
			$("#"+id).removeClass("error-form");
			$("#alert-"+id).hide("fast");
		}
	}
	return err;
}


function Redirect(pTargetUrl, pErrSection, pErrCode){
    document.formRedirect.action= pTargetUrl;
    document.formRedirect.ERROR_SECTION.value= pErrSection;
    document.formRedirect.ERROR_CODE.value= pErrCode;
    
    document.formRedirect.submit();
}    

$(document).ready(function() {
    $("#ContinueButton").click(
        function(){
            document.formRedirect.submit();
        }
        );
    $("#RollbackButton").click(
        function(){
            document.formRollback.submit();
        }
        );
});

